using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace The_LarX
{
    public class SerializeData
    {
        public DataCollection Data = new DataCollection();

        public string Parent;

        public bool IsService;

        public void AddData(string Key, object info)
        {
            if (!Data.Contains(Key))
            {
                Data.Add(new Data(Key, info));
            }
        }
        public T GetData<T>(string Key)
        {
            try
            {
                if (Data.Contains(Key))
                {
                    Data tata = Data[Key].GetData();
                    return (T)tata.Object;
                }
                else
                {
                    return default(T);
                }
            }
            catch
            {
                return default(T);
            }
        }
        public bool ContainsData(string Key)
        {
            return Data.Contains(Key);
        }

        public SerializeData(string Parent)
        {
            this.Parent = Parent;
        }
        public SerializeData()
        {
        }
    }
}